<%@ page language="java"  pageEncoding="utf-8"%>
<%@page import="cn.biplam.test.TestDbConnect"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>数据库导入</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script>
	   function doit(x){
	       document.myform.action="test.jsp?show="+x;
	       document.forms.myform.submit();
	   }
	</script>
  </head>
  
  <body>
     <form name="myform" action="" method="post">
	    <table border="1" bordercolor="blue" align="center" width="100%">
	         <tr>
	            <td>
	                <input type="button" value="数据库'连接'测试" onclick="doit('1')"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	                <input type="button" value="数据库'查询'测试" onclick="doit('2')">
	            </td>
	         </tr>
	    </table>
	    <%
	      String x = request.getParameter("show");
	      if(x!=null){
	      	  String[] str = null;
	          TestDbConnect test = new TestDbConnect();
	          if("1".equals(x)){
	          	  str = test.getDbConnect();
	          }else{
	          	  str = test.getDbConnectQuary();
	          }
	     %>
	    <table border="1" bordercolor="red" align="center" width="100%">
	         <tr>
	            <td>
	                <%=str[0] %><br>
	                <%=str[1] %>
	            </td>
	         </tr>
	    </table>
	    <%
	       
	     }
	     %>
	</form>
  </body>
</html>
